home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_tem_watersplash.cog < prev    next >
Text File  |  1999-11-15  |  3KB  |  99 lines

  1. # Jones 3D Cog Script
  2. #
  3. # TEM_WaterSplash.cog
  4. #
  5. # [TRM]
  6. #
  7. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  8. # ========================================================================================
  9.  
  10. symbols
  11.  
  12.     message     entered
  13.     message     timer
  14.     
  15.     thing       origin          # Where the bubbles are coming from
  16.     thing       wave            local
  17.     thing       player          local
  18.     
  19.     sector      sec_on0         linkID=1
  20.     sector      sec_on1         linkID=1
  21.     
  22.     sector      sec_off0        linkID=0
  23.     sector      sec_off1        linkID=0
  24.     
  25.     template    splash0=+ripples2     local
  26.     template    splash1=+ripples      local
  27.     template    splash2=+ripples      local
  28.     
  29.     vector      vecPos          local
  30.     vector      startWave       local
  31.     vector      finWave         local
  32.     
  33.     int         i=0             local
  34.     int            waves=5            local
  35.     int         randNum         local
  36.     int         splashing=0     local
  37.     
  38.     flex        fin_XY          local
  39.     
  40. end
  41.  
  42. # ========================================================================================
  43.  
  44. code
  45.  
  46. entered:
  47.  
  48.     if((GetSenderID() == 1) && (splashing == 0))
  49.     {
  50.         Print("splashing on");
  51.         splashing = 1;
  52.         SetTimer(0.5);
  53.     }
  54.     
  55.     if(GetSenderID() == 0)
  56.     {
  57.         Print("splashing off");
  58.         splashing = 0;
  59.         SetTimer(0.0);
  60.     }
  61.  
  62.     return;
  63.     
  64. # ========================================================================================
  65.  
  66. timer:
  67.  
  68.     vecPos = VectorSet(rand()*0.15, rand()*0.15, 0);
  69.     
  70.     # randomize finish size
  71.     randNum = RandBetween(1, 3);
  72.     if(randNum == 1) fin_XY = 0.1;
  73.     else if(randNum == 2) fin_XY = 0.3;
  74.     else if(randNum == 3) fin_XY = -0.05;
  75.     
  76.     for(i=0; i<waves; i=i+1)                                                                        
  77.     {                                                                                                    
  78.         wave = CreateThingAtPos(splash0[RandBetween(0, 2)], GetThingSector(origin), VectorAdd(GetThingPos(origin), VectorAdd('-0.025 -0.035 0.0', vecPos)), '0 0 0');
  79.         CaptureThing(wave);
  80.         
  81.         startWave = VectorSet(0.01, 0.01, 1.0);
  82.         finWave = VectorSet(0.3+fin_XY, 0.3+fin_XY, 0.0); # 0.15
  83.         AnimateSpriteSize(wave, startWave, finWave, 1.3);
  84.     }
  85.     
  86.     
  87.     if(i == 5)
  88.     {
  89.         i = 0;
  90.         SetTimer(0.5);
  91.     }
  92.     
  93.     return;   
  94.     
  95. # ========================================================================================
  96.  
  97. end
  98.  
  99.